package exercise6;

public class Exercise13_12 {
    public static void main(String []args){
        Circle circle1=new Circle(2);
        Rectangle rectangle=new Rectangle(2,3);

        My_Geometric[] a={circle1,rectangle};

        System.out.println("总面积是："+sumArea(a));
    }

    public static double sumArea(My_Geometric[] a) {
        double sum = 0;

        for (int i = 0; i < a.length; i++)
            sum += a[i].getArea();

        return sum;
    }
}
